/*
Copyright (C) 2008 Matthew Perry

This library is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This libary/program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Collections.Generic;

namespace BaseTools.Configuration
{
	using GenericSection = Dictionary<string, string>; 
	using GenericApplication = Dictionary<string, Dictionary<string, string>>;
	
	/// <summary>
	/// Interface for an ini-style reader
	/// </summary>
	public interface IIni
	{
		/// <summary>
		/// Save the configuration to a file
		/// </summary>
		/// <param name="filename">The filename</param>
		/// <param name="lst">The GenericApplication to write</param>
		void SaveConfiguration(string filename, GenericApplication lst);
		
		/// <summary>
		/// Save the configuration to a string
		/// </summary>
		/// <param name="lst">The GenericApplication to write</param>
		/// <returns>A string representing the GenericApplication</returns>
		string WriteConfiguration(GenericApplication lst);
		
		/// <summary>
		/// Load the configuration from a file
		/// </summary>
		/// <param name="filename">The filename</param>
		/// <returns>A GenericApplication interpreted from the file</returns>
		GenericApplication LoadConfiguration(string filename);
		
		/// <summary>
		/// Load the configuration from a string
		/// </summary>
		/// <param name="data">The data</param>
		/// <returns>A GenericApplication interpreted from the string</returns>
		GenericApplication ReadConfiguration(string data);
	}
}
